﻿import axios from 'axios'
import config from './config.js'
import "./mock/mymock.js"

var baseURL = config.baseURL;
axios.interceptors.request.use(function (config) {
	config.validateStatus=function (status) {
		return status >= 200 && status <= 300;
	};
	config.headers['x-requested-with']="XMLHttpRequest";
	return config;
}, function (error) {
	return Promise.reject(error);
});

axios.interceptors.response.use(function (response) {
	return response
}, function (error) {
	return Promise.reject(error)
});

/*表格测试数据*/
export const tableTest_refresh=function(params){
	return axios(
		{
			method: 'post',
			url: 'table-test.json',
			data: params
		}
	)
}
//导航测试数据
export const nav_request=function(params){
	return axios(
		{
			method: 'post',
			url: 'menuData.json',
			data: params
		}
	)
}
